#define _CRT_SECURE_NO_WARNINGS 1
#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;
string s;
int cnt1, cnt2;
int main()
{
	int n;
	cin >> n;
	cin >> s;
	for (int i = 0; i < n; i++)
	{
		if (s[i] == 'T')
			cnt1++;
		else if (s[i] == 'A')
			cnt2++;
	}
	if (cnt1 > cnt2)
		cout << "T" << endl;
	else if (cnt1 < cnt2)
		cout << "A" << endl;
	else
	{
		if (s[n - 1] == 'A') cout << "T" << endl;
		else if (s[n - 1] == 'T') cout << "A" << endl;
	}
	return 0;
}